This works for me:
with tf.device("/cpu:0"):
or
with tf.device("/gpu:0"):
Topic:
Machine Learning & AI
SubTopic:
General
Tags: